home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jaz_clib.arc / JZCNTSTR.C < prev    next >
Text File  |  1989-04-09  |  610b  |  25 lines

  1. /*
  2. ┌────────────────────────────────────────────────────────────────────────────┐
  3. │jzcntstr                                     │
  4. │Return a string padded with blanks on the left so as to center it in a      │
  5. │given field width.                                 │
  6. │                                         │
  7. │ (C) JazSoft Software by Jack A. Zucker (301) 794-5950              │
  8. └────────────────────────────────────────────────────────────────────────────┘
  9. */
  10.  
  11. char *jzcntstr(fstr,fwidth)
  12. char *fstr;
  13. int fwidth;
  14. {
  15.   static char wstr[256];    /* static work buffer */
  16.  
  17.   strcpy(wstr,jzpad((fwidth-strlen(fstr)) >> 1,' '));
  18.  
  19.   strcat(wstr,fstr);
  20.  
  21.   return(wstr);
  22. }
  23.  
  24.  
  25.